import http from '@/utils/request'

// 视频相关接口
export const videoApi = {
  // 获取视频上传凭证
  getUploadAuth(data) {
    return http.post('/video/upload/auth', data)
  },

  // 刷新上传凭证
  refreshUploadAuth(data) {
    return http.post('/video/upload/auth/refresh', data)
  },

  // 创建视频
  createVideo(data) {
    return http.post('/video/create', data)
  },

  // 获取视频播放凭证
  getPlayAuth(vId) {
    return http.get(`/video/play/auth/${vId}`)
  },

  // 获取视频播放地址
  getPalyInfo(vodId) {
    return http.get(`/video/play/info/${vodId}`)
  },

  // 获取热门视频列表
  getHotVideoList() {
    return http.get('/video/list')
  },

  // 获取视频详情
  getVideoDetail(vId) {
    return http.get(`/video/${vId}`)
  },

  // 更新视频信息
  updateVideo(vId, data) {
    return http.put(`/video/${vId}`, data)
  },

  // 点赞视频
  likeVideo(vId) {
    return http.post(`/video/${vId}/like`)
  },
}
